package com.example.lending.Model.Dao;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.lending.Model.Favor;

import java.util.List;

@Dao
public interface FavorDao {
    @Insert
    void insertFavor(Favor... favors);

    @Update
    void updataFavor(Favor... favors);

    @Delete
    void deleteFavor(Favor... favors);

    @Query("delete from favor")
    void deleteAllFavor();

    @Query("select * from favor order by id desc")
    LiveData<List<Favor>> getAllFavorLive();


}
